import java.util.*;
        import java.math.*;

 class ListNode {
     int val;
     ListNode next = null;

     public ListNode(int val) {
         this.val = val;
     }
 }

public class test {
     // 牛客 链表相加
    public ListNode addInList (ListNode head1, ListNode head2) {
        ListNode cur1 = doNode(head1);
        ListNode cur2 = doNode(head2);
        // 739
        // 36
        ListNode cur = new ListNode(0);
        ListNode head = cur;
        int next = 0;
        while (cur1 != null && cur2 != null) {
            int a = cur1.val + cur2.val + next;
            next = 0;
            if (a >= 10) {
                a %= 10;
                next++;
            }
            cur.next = new ListNode(a);
            System.out.println("1 2 :" + a);
            cur = cur.next;
            cur1 = cur1.next;
            cur2 = cur2.next;
        }
        while (cur1 != null) {
            int a = cur1.val + next;
            next = 0;
            if (a >= 10) {
                a %= 10;
                next++;
            }
            cur.next = new ListNode(a);
            cur = cur.next;
            System.out.println("1 :" + a);
            cur1 = cur1.next;
        }
        while (cur2 != null) {
            int a = cur2.val + next;
            next = 0;
            if (a >= 10) {
                a %= 10;
                next++;
            }
            cur.next = new ListNode(a);
            cur = cur.next;
            System.out.println("2 :" + a);
            cur2 = cur2.next;
        }
        if(next != 0){
            cur.next = new ListNode(1);
        }
        // 0 0 0 0 1
        // 1 0 0 0 0
        head = doNode(head.next);
        return head;
    }
    public ListNode doNode (ListNode head) {
        if (head == null || head.next == null) {
            return head;
        }
        ListNode cur = head;
        ListNode curn = head.next;
        while (curn != null) {
            ListNode curnn = curn.next;
            curn.next = cur;
            cur = curn;
            curn = curnn;
        }
        head.next = null;
        return cur;
    }
    // 岛屿数量
    public boolean[][] count;
    public int[] dx = {0,0,1,-1};
    public int[] dy = {1,-1,0,0};
    public int row;
    public int col;
    public int num;
    public int solve (char[][] grid) {
        // write code here
        row = grid.length;
        col = grid[0].length;
        count = new boolean[row + 1][col + 1];
        for(int i = 0;i < row;i++){
            for(int j = 0;j < col;j++){
                if(grid[i][j] == '1' && !count[i][j]){
                    bfs(grid,i,j);
                    num++;
                }
            }
        }
        return num;
    }
    public void bfs(char[][] grid,int nx,int ny){
        Queue<int[]> queue = new LinkedList<>();
        queue.add(new int[]{nx,ny});
        count[nx][ny] = true;
        while(!queue.isEmpty()){
            int[] t = queue.poll();
            for(int i = 0;i < 4;i++){
                int x = t[0] + dx[i];
                int y = t[1] + dy[i];
                if(x >= 0 && x < row && y >= 0 && y < col && !count[x][y] && grid[x][y] == '1'){
                    queue.add(new int[]{x,y});
                    count[x][y] = true;
                }
            }
        }
    }
    // 牛客 拼三角
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
// 注意 hasNext 和 hasNextLine 的区别
        int t = in.nextInt();
        while (t-- > 0) {
            int[] arr = new int[6];
            boolean flg = false;
            for (int i = 0; i < 6; i++) {
                arr[i] = in.nextInt();
            }
            out:
            for (int i = 0; i < 6; i++) {
                for (int j = i + 1; j < 6; j++) {
                    for (int k = j + 1; k < 6; k++) {
//如果此时的三条边合法
                        if (three(arr[i], arr[j], arr[k])) {
                            int a = -1;
                            int b = -1;
                            int c = -1;
                            for (int h = 0; h < 6; h++) {
                                if (h != i && h != j && h != k) {
                                    if (a == -1) {
                                        a = h;
                                    } else if (b == -1) {
                                        b = h;
                                    } else {
                                        c = h;
                                    }
                                }
                            }
                            if (three(arr[a], arr[b], arr[c])) {
                                System.out.println("Yes");
                                flg = true;
                                break out;
                            }
                        }
                    }
                }
            }
            if (!flg) {
                System.out.println("No");
            }
        }
    }
    public static boolean three(int x, int y, int z) {
        if (x + y > z && x + z > y && y + z > x) {
            return true;
        }
        return false;
    }
}
